package com.neuedu.opp03ex;

public class ComputerStudent extends Student {
    /**
     * 操作分数
     */
    private double operational;
    /**
     * 英语写作分数
     */
    private double englishWriting;

    /**
     * 空参构造
     */
    public ComputerStudent() {
    }

    /**
     * 全参构造
     */
    public ComputerStudent(String stuId, String name, String gender, int age,
                           double midTermExam, double finalExam, double operational, double englishWriting) {
        super(stuId, name, gender, age, midTermExam, finalExam);
        this.operational = operational;
        this.englishWriting = englishWriting;
    }

    /**
     *get和set方法
     */
    public double getOperational() {
        return operational;
    }

    public void setOperational(double operational) {
        this.operational = operational;
    }

    public double getEnglishWriting() {
        return englishWriting;
    }

    public void setEnglishWriting(double englishWriting) {
        this.englishWriting = englishWriting;
    }

    /**
     * 重写获取综合成绩的方法
     * @return
     */
    @Override
    public double score() {
        return (this.operational * 0.4 + this.englishWriting * 0.2
                + this.midTermExam * 0.2 + this.finalExam * 0.2);
    }
}
